Skip to content

Conversation

yannick-couzinie
Copy link

pauli_string_to_matrix takes a device argument, which defaults to torch.device('cpu'):

def pauli_string_to_matrix(pauli: str, device=torch.device('cpu')) -> torch.Tensor:

When trying to use Hamiltonian on GPU this invariably leads to device errors, since the result from pauli_string_to_matrix will be on CPU, so it would be nice to be able to pass device to Hamiltonian, which passes it on to pauli_string_to_matrix. Setting the default to None ensures that not previous behaviour is changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant